package demo2;

public class Text {

    public static void swap(MyValue m1 ,MyValue m2){
        int tmp = m1.value;
        m1.value = m2.value;
        m2.value = tmp;
    }

    public static void main(String[] args) {
        MyValue myv1 = new MyValue();
        MyValue myv2= new MyValue();

        myv1.value = 10;
        myv2.value = 20;

        System.out.println(myv1.value);
        System.out.println(myv2.value);

        swap(myv1,myv2);

        System.out.println(myv1.value);
        System.out.println(myv2.value);


    }
}
